home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 037a / tpnetbio.zip / NETBIOS.DOC next >
Text File  |  1988-04-10  |  57KB  |  1,346 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.         ##    ##  ####### ########      ######   ####    ##      ######
  17.         ###   ##  ##         ##         ##   ##   ##   ##  ##   ##    ##
  18.         ####  ##  ##         ##         ##   ##   ##  ##    ##  ##      
  19.         ## ## ##  #####      ##         ######    ##  ##    ##   ###### 
  20.         ##  ####  ##         ##         ##   ##   ##  ##    ##        ##
  21.         ##   ###  ##         ##         ##   ##   ##   ##  ##    ##   ##
  22.         ##    ##  #######    ##         ######   ####    ##       ##### 
  23.  
  24.  
  25.  
  26.                                   CBIS Net Bios
  27.                              Programmer's Reference
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.                                  by Tom Thompson
  36.  
  37.                                    April 1988
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.                                     CBIS,Inc.
  47.                          5875 Peachtree Industrial Blvd.
  48.                               Bldg. 100  Suite 170
  49.                                Norcross, GA  30092
  50.  
  51.  
  52.  
  53.  
  54.         Copyright (c) 1988 by CBIS, Inc.  All rights reserved.  No part 
  55.         of this publication may be reproduced without the prior written 
  56.         permission of CBIS, Inc., P.O. Box 921206, Norcross, GA 30092.
  57.  
  58.         CBIS, Inc. makes no representations or warranties with respect to 
  59.         the contents hereof and specifically disclaims any warranties 
  60.         either expressed or implied of merchantability or fitness for any 
  61.         particular purpose.  CBIS, Inc. reserves the right to change this 
  62.         publication and the software programs to which it relates with no 
  63.         obligation to notify any person or organization of such changes.
  64.  
  65.  
  66.  
  67.  
  68.                                 TABLE OF CONTENTS
  69.  
  70.  
  71.  
  72.                   Introduction . . . . . . . . . . . . . . . . .  1
  73.  
  74.                   Net Bios . . . . . . . . . . . . . . . . . . .  1
  75.  
  76.                   Names  . . . . . . . . . . . . . . . . . . . .  2
  77.  
  78.                   Calling Net Bios . . . . . . . . . . . . . . .  2
  79.  
  80.              General Commands
  81.                   Reset Command  . . . . . . . . . . . . . . . .  5
  82.                   Cancel Command . . . . . . . . . . . . . . . .  5
  83.                   Adapter Status Command . . . . . . . . . . . .  5
  84.                   Unlink Command . . . . . . . . . . . . . . . .  6
  85.  
  86.              Name Commands
  87.                   Add Name Command . . . . . . . . . . . . . . .  6
  88.                   Add Group Name Command . . . . . . . . . . . .  6
  89.                   Delete Name Command  . . . . . . . . . . . . .  6
  90.  
  91.              Session Control Commands
  92.                   Call Command . . . . . . . . . . . . . . . . .  7
  93.                   Listen Command . . . . . . . . . . . . . . . .  7
  94.                   Hang Up Command  . . . . . . . . . . . . . . .  8
  95.                   Session Status Command . . . . . . . . . . . .  8
  96.  
  97.              Session Data Transfer Command
  98.                   Send Command . . . . . . . . . . . . . . . . .  8
  99.                   Chain Send Command . . . . . . . . . . . . . .  9
  100.                   Receive Command  . . . . . . . . . . . . . . .  9
  101.                   Receive Any Command. . . . . . . . . . . . . .  9
  102.  
  103.              Datagram Commands
  104.                   Send Datagram Command  . . . . . . . . . . . . 10
  105.                   Receive Datagram Command . . . . . . . . . . . 10
  106.                   Send Broadcast Command . . . . . . . . . . . . 11
  107.                   Receive Broadcast Command  . . . . . . . . . . 11
  108.  
  109.              Tables
  110.                   1 - Net Bios Command Summary . . . . . . . . . 12
  111.                   2 - Net Bios Control Block (NCB) Format  . . . 13
  112.                   3 - NCB Usage by Command . . . . . . . . . . . 14
  113.                   4 - Net Bios Error Codes . . . . . . . . . . . 15
  114.                   5 - Adapter Status Result Buffer . . . . . . . 17
  115.                   6 - Session Status Result Buffer . . . . . . . 18
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.                                        i
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.                                       ii
  187.  
  188.  
  189.  
  190.                   ------------
  191.                   Introduction
  192.                   ------------
  193.  
  194.         This document describes the programming interface for CBIS' Net 
  195.         Bios, which has been implemented for several networks, including 
  196.         ARCNET, EtherNet, StarLan, PC-Office NetBoard, and several 
  197.         internal bus topologies.
  198.  
  199.         Presented first is a general discussion of Net Bios.  This is 
  200.         followed by assembly language calling procedures.  Then each Net 
  201.         Bios command is described.  Finally, all tables are contained at 
  202.         the end of the document.
  203.  
  204.  
  205.  
  206.                   --------
  207.                   Net Bios
  208.                   --------
  209.  
  210.         Net Bios provides a hardware-independent interface to a network 
  211.         transport facility.  Two processes, on the same or different 
  212.         machines, use the Net Bios to exchange data.  These processes 
  213.         depend on the Net Bios to perform error checking, sequencing, and 
  214.         routing.
  215.  
  216.         The services provided by the Net Bios can be broken into five 
  217.         groups.
  218.  
  219.              1.   General.  Configuration and status.
  220.  
  221.              2.   Name.  A process or machine is identified by a name.  
  222.                   Multiple names are supported by each machine.  Names 
  223.                   may be added and deleted.
  224.  
  225.              3.   Session control.  A virtual connection, or session, can 
  226.                   be established between processes or applications.  A 
  227.                   process might establish multiple sessions with remote 
  228.                   processes.  Commands are provided for waiting for a 
  229.                   connection request from another (LISTEN), making a 
  230.                   connection request (CALL), and terminating a connection 
  231.                   (HANG UP).  Throughout this document, a virtual 
  232.                   connection is referred to as a session.
  233.  
  234.              4.   Session data transfer.  Once a session is established, 
  235.                   the Net Bios maintains tables that allow the process to 
  236.                   specify the remote process for data transfer with a 
  237.                   number, or handle.  Send and receive commands are 
  238.                   provided.  In addition, a "receive any" command allows 
  239.                   a process to receive messages from any of the sessions 
  240.                   it has established.
  241.  
  242.              5.   Datagram.  Datagrams provide a means to transfer data 
  243.                   between processes without using the session mechanism.  
  244.                   Messages may be sent to a given name, a group name, or 
  245.  
  246.  
  247.                                        1
  248.  
  249.  
  250.  
  251.                   to all processes.  These type messages do not provide 
  252.                   the same reliability as session data transfer, since 
  253.                   the sender will not be notified when messages are 
  254.                   undeliverable.
  255.  
  256.  
  257.  
  258.                   -----
  259.                   Names
  260.                   -----
  261.  
  262.         The Net Bios supports user added names.  A given machine on the 
  263.         network is known (i.e., can be found by other machines) by these 
  264.         names.  Names are 16 characters long and should not contain the 
  265.         asterisk (*) character.  Each Net Bios also has a permanent name, 
  266.         which consists of 10 characters of binary zeros followed by 6 
  267.         more characters which must be unique on the network (typically, 
  268.         this "node number" is in PROM on a LAN card or configurable by 
  269.         DIP switches).  Up to 16 user names may be added to the Net Bios.  
  270.         These are kept in the "local name table".
  271.  
  272.         Data transfer and session establishment is normally associated 
  273.         with one of the local names.  For example, a datagram may be 
  274.         "sent to" a name. A session request (CALL) would be associated 
  275.         with two names.  The name used by the requester and the name of 
  276.         the process with which a session is desired.
  277.  
  278.  
  279.  
  280.                   ----------------
  281.                   Calling Net Bios
  282.                   ----------------
  283.  
  284.         Calling the Net Bios is accomplished by building a Net Bios 
  285.         Control Block (NCB), and execute an INT 5Ch with registers ES:BX 
  286.         containing the address of the NCB.  When control is returned, 
  287.         only AX is changed.
  288.  
  289.         The NCB is 64 bytes long and is shown in Table 2.  The COMMAND 
  290.         field describes the basic function of the command.  All commands 
  291.         are listed in Table 1.  On selected commands, the high order bit 
  292.         of the COMMAND field can be set to indicate the "no-wait" mode.  
  293.         This feature, coupled with the value contained in the POST field, 
  294.         results in three distinct ways that the Net Bios can signal 
  295.         command completion:
  296.  
  297.              1.   No-wait bit not set.  In this case, the post address is 
  298.                   ignored and control will not be returned from INT 5Ch 
  299.                   until after the command has completed.  The RETCODE 
  300.                   field and the AL register will contain the result of 
  301.                   the operation (see Table 4 for error codes).
  302.  
  303.              2.   No-wait bit set and POST contains 0:0.  The Net Bios 
  304.                   will (after minimum processing) return immediately, 
  305.                   even though the command may not have completed.  On 
  306.  
  307.  
  308.                                        2
  309.  
  310.  
  311.  
  312.                   return, the AL register will contain an "immediate 
  313.                   error" code or 0.  If AL is not 0, then the command 
  314.                   could not be queued (e.g., invalid COMMAND code).  If 
  315.                   AL is 0, then the process should poll the CMD_DONE 
  316.                   field of the NCB, waiting for some value other than 
  317.                   0FFh.  When CMD_DONE is not equal to 0FFh, the command 
  318.                   has completed and all other NCB fields are valid.
  319.  
  320.              3.   No-wait bit set and POST contains the address of a user 
  321.                   routine.  The Net Bios will return immediately, even 
  322.                   though the command may not have completed.  On return, 
  323.                   the AL register will contain an "immediate error" code 
  324.                   or 0.  If AL is not 0, then the command could not be 
  325.                   queued (e.g., invalid COMMAND code).  If AL is 0, then 
  326.                   the user's POST routine will be called after the 
  327.                   command is completed.  When the POST routine is called, 
  328.                   interrupts are off, the stack is set for an IRET, and 
  329.                   ES:BX contains the address of the completed NCB. 
  330.  
  331.         Table 1 shows NCB COMMAND field codes, Table 3 shows field usage 
  332.         by command, and Table 4 shows error codes returned in AL and 
  333.         RETCODE.
  334.  
  335.         Typically, a POST routine can issue another Net Bios command.  
  336.         However, some implementations may return an immediate error 21h 
  337.         (interface busy) on nested interrupt conditions.  If the user is 
  338.         issuing commands from either the POST routine or other hardware 
  339.         routines, then the user must be prepared to queue NCBs that need 
  340.         starting and start them from, say, a timer tick whenever an 
  341.         interface busy error is encountered.  This same logic can also 
  342.         cover the case where the Net Bios is temporarily out of resources 
  343.         (immediate error 09h).  Normally, do not always queue the NCBs 
  344.         for later starting (may dramatically reduce throughput), only do 
  345.         it when the errors 21h or 09h are encountered.
  346.  
  347.         The user POST routine should be as short as possible and no 
  348.         registers should be changed.  Interrupts may be enabled in the 
  349.         POST routine.
  350.  
  351.         In some cases, the user's POST routine will be called before 
  352.         control is returned from the INT 5Ch that started the command.
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.                                        3
  370.  
  371.  
  372.  
  373.         A typical sequence of Net Bios commands is listed below.
  374.  
  375.              1. ADD NAME
  376.              2. CALL
  377.              3. SEND
  378.              4. RECEIVE
  379.              5. Repeat 3,4 as needed
  380.              6. HANG UP
  381.              7. DELETE NAME
  382.  
  383.         Depending on the design of the application, the process doing the 
  384.         above may send a specific message to the other end informing it 
  385.         of the intention to HANG UP.  This would not be necessary if the 
  386.         other end was executing the following sequence.
  387.  
  388.              1. ADD NAME
  389.              2. LISTEN
  390.              3. RECEIVE
  391.              4. If time-out goto 3
  392.              5. If session lost goto 2
  393.              6. SEND
  394.              7. Goto 3
  395.              
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.                                        4
  431.  
  432.  
  433.  
  434.                   -------------
  435.                   Reset Command
  436.                   -------------
  437.  
  438.         The RESET command clears and configures the Net Bios.  The number 
  439.         of sessions to be supported is supplied in the LSN field (1 to 
  440.         32).  The maximum number of commands (NCBs) outstanding at one 
  441.         time is specified in the NUM field (also 1 to 32).
  442.  
  443.         When this command is issued, all existing names and sessions are 
  444.         lost, therefore it should be issued before starting any processes 
  445.         that use the Net Bios.
  446.  
  447.         In some implementations, session and command buffers take space 
  448.         otherwise used for packet buffers.  Therefore, keep these 
  449.         parameters reasonable.
  450.  
  451.  
  452.  
  453.                   --------------
  454.                   Cancel Command
  455.                   --------------
  456.  
  457.         This command is used to cancel a previous command.  The address 
  458.         of the NCB for the previous command is passed in BUFADR.  No-wait 
  459.         mode is not allowed for the cancel command.  The following 
  460.         commands cannot be canceled:  RESET, CANCEL, ADD NAME, ADD GROUP 
  461.         NAME, DELETE NAME, SESSION STATUS, SEND DATAGRAM and SEND 
  462.         BROADCAST.  SEND and CHAIN SEND may be canceled, but the session 
  463.         will be terminated.
  464.  
  465.  
  466.  
  467.  
  468.                   ----------------------
  469.                   Adapter Status Command
  470.                   ----------------------
  471.  
  472.         This command is used to get the status of a Net Bios -- either 
  473.         local or remote.  CALLNAME specifies a name used to search for 
  474.         the appropriate Net Bios.  If the first character of CALLNAME is 
  475.         an asterisk (*), then status is returned for the local Net Bios.
  476.  
  477.         The status is placed in the buffer addressed by BUFADR.  The 
  478.         format is shown in Table 5.  The maximum number of bytes returned 
  479.         will be 348.  The actual number will be 60 + 18n, where n is the 
  480.         number of names in the name table of the selected Net Bios (the 
  481.         permanent node name is not counted).
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.                                        5
  492.  
  493.  
  494.  
  495.                   --------------
  496.                   Unlink Command
  497.                   --------------
  498.  
  499.         This command is used to cancel diskless boot redirection.  
  500.         Typically, a diskless boot ROM makes a connection with a process 
  501.         that supplies a virtual floppy image and redirects INT 13 
  502.         requests for drive A to this network device.  This command 
  503.         cancels that redirection so that the local drive A may be 
  504.         accessed.  Once this command is issued, there is no way to re-
  505.         establish the diskless boot connection.
  506.  
  507.  
  508.  
  509.                   ----------------
  510.                   Add Name Command
  511.                   ----------------
  512.  
  513.         This command adds a name to the Net Bios local name table.  The 
  514.         name must be unique across the network.  The name, up to 16 
  515.         characters long, is supplied in the NAME field.  If the operation 
  516.         is successful, then the NUM field is used to return a number from 
  517.         1 to 254 associated with the name.
  518.  
  519.  
  520.  
  521.                   ----------------------
  522.                   Add Group Name Command
  523.                   ----------------------
  524.  
  525.         This command adds a non-unique name to the Net Bios local name 
  526.         table.  The name must not be added as a unique name by any other 
  527.         process or machine.  The name, up to 16 characters long, is 
  528.         supplied in the NAME field.  If the operation is successful, then 
  529.         the NUM field is used to return a number from 1 to 254 associated 
  530.         with the name.
  531.  
  532.         The main use of group names is to provide a mechanism to 
  533.         "broadcast" messages to a group.  SEND DATAGRAM to a group name 
  534.         will be received by all processes that have issued a RECEIVE 
  535.         DATAGRAM under the group name.
  536.  
  537.  
  538.  
  539.                   -------------------
  540.                   Delete Name Command
  541.                   -------------------
  542.  
  543.         This command deletes a name from the Net Bios local name table.  
  544.         If no sessions are active under the name to be deleted, the name 
  545.         will be deleted.  If any sessions are active, then the command 
  546.         will not complete until these sessions are terminated.
  547.  
  548.         Any of the following commands outstanding and associated with the 
  549.         deleted command will be terminated with RETCODE = 17h (name was 
  550.  
  551.  
  552.                                        6
  553.  
  554.  
  555.  
  556.         deleted): LISTEN, RECEIVE ANY, RECEIVE DATAGRAM, RECEIVE 
  557.         BROADCAST.
  558.  
  559.  
  560.  
  561.                   ------------
  562.                   Call Command
  563.                   ------------
  564.  
  565.         This command is used to establish a session with another machine 
  566.         or process.  The remote name is supplied in CALLNAME and the 
  567.         local name is specified in NAME.  In addition, session data 
  568.         transfer time-outs must be specified in RTO and STO.
  569.  
  570.         A LISTEN command must be outstanding for the called (remote) 
  571.         name.  When the CALL completes successfully, a session number 
  572.         (from 1 to 254) is returned in LSN.  This number is used when 
  573.         sending or receiving session data, or in the HANG UP (session 
  574.         terminate) command.
  575.  
  576.  
  577.  
  578.                   --------------
  579.                   Listen Command
  580.                   --------------
  581.  
  582.         This command is used to wait for a session to be established.  
  583.         The session will be established when another machine or process 
  584.         executes a CALL to the name associated with the LISTEN command.  
  585.         The NAME field contains the local name under which the session 
  586.         will be established.  The CALLNAME field contains the name of the 
  587.         caller, or an asterisk (*) in the first character to accept a 
  588.         call from any name.  Session data transfer time-outs must be 
  589.         specified in RTO and STO.
  590.  
  591.         When the LISTEN completes successfully, a session number (from 1 
  592.         to 254) is returned in LSN.  This number is used when sending or 
  593.         receiving session data, or in the HANG UP (session terminate) 
  594.         command.  If an asterisk (*) is used as the CALLNAME, then the 
  595.         caller's name will be returned in CALLNAME upon successful 
  596.         completion of the listen.
  597.  
  598.         More than one session can be established under the same name, or 
  599.         same pair of names.
  600.  
  601.         If a CALL is received for a name for which there is a LISTEN with 
  602.         a matching CALLNAME, and there is also a LISTEN for any name 
  603.         (asterisk in first character), then the specific LISTEN will be 
  604.         completed, regardless of the order in which the LISTENs were 
  605.         issued.
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.                                        7
  614.  
  615.  
  616.  
  617.                   ---------------
  618.                   Hang Up Command
  619.                   ---------------
  620.  
  621.         This command is used to close or terminate a session.  It may be 
  622.         issued by either the CALLer or LISTENer.  The LSN field contains 
  623.         the session number of the session to be closed.
  624.  
  625.         If any RECEIVE commands for the session are outstanding on the 
  626.         machine issuing the HANG UP, they are completed with RETCODE = 
  627.         0Ah (session closed).  If SEND commands are outstanding, the HANG 
  628.         UP completion will be delayed until the SEND has completed.
  629.  
  630.         If the remote end has any RECEIVE or SEND commands in progress 
  631.         when HANG UP is started, they will be terminated with RETCODE = 
  632.         0Ah.  If no remote RECEIVEs or SENDs are terminated with session 
  633.         closed, and if RECEIVE ANY commands are outstanding at the 
  634.         remote, one and only one of the RECEIVE ANYs will be terminated 
  635.         with the session closed error.  If no commands are outstanding at 
  636.         the remote machine when the HANG UP occurs, then the next session 
  637.         command issued by the remote will be terminated RETCODE set to 
  638.         either 08h (invalid session) or 0Ah (session closed).
  639.  
  640.  
  641.  
  642.                   ----------------------
  643.                   Session Status Command
  644.                   ----------------------
  645.  
  646.         This command is used to obtain status of all sessions associated 
  647.         with a given name.  The NAME field contains the name for which 
  648.         status is desired.  The BUFADR field contains the address of a 
  649.         buffer for the status report and BUFLEN contains the buffer 
  650.         length.  Table 6 shows the format of the status.  BUFLEN must be 
  651.         at least 4.  If the buffer is not large enough to hold the 
  652.         complete report, then it is filled and a RETCODE = 06h (message 
  653.         incomplete is returned).
  654.  
  655.  
  656.  
  657.                   ------------
  658.                   Send Command
  659.                   ------------
  660.  
  661.         This command sends data to the machine or process with which a 
  662.         session as been established.  The LSN field is set to the session 
  663.         number, and BUFADR and BUFLEN are set to the size and length of 
  664.         the data to be transferred.  The remote session must have issued 
  665.         (or issue before the time-out specified earlier in STO) a RECEIVE 
  666.         or RECEIVE ANY command.
  667.  
  668.         SENDs are performed in the order in which they are issued.  If an 
  669.         error occurs on the send, then the session is terminated.
  670.  
  671.  
  672.  
  673.  
  674.                                        8
  675.  
  676.  
  677.  
  678.                   ------------------
  679.                   Chain Send Command
  680.                   ------------------
  681.  
  682.         The CHAIN SEND command is similar to the SEND command, except the 
  683.         data to be transferred is contained in two separate buffers.  
  684.         CHAIN send concatenates these buffers -- the receiving end will 
  685.         see one message.  The first part of the message is defined by 
  686.         BUFADR and BUFLEN.  The address of the second part is stored in a 
  687.         double word at CALLNAME+2.  The length of the second part is 
  688.         stored in a word at CALLNAME+0.  The total length cannot exceed 
  689.         65535 bytes.
  690.  
  691.  
  692.  
  693.                   ---------------
  694.                   Receive Command
  695.                   ---------------
  696.  
  697.         This command receives data from the machine or process with which 
  698.         a session as been established.  The LSN field is set to the 
  699.         session number, and BUFADR and BUFLEN are set to the size and 
  700.         maximum length of the receive data buffer.  The remote session 
  701.         must issue a SEND or CHAIN SEND command.  If a send is not issued 
  702.         by the remote within the time specified earlier in RTO, the 
  703.         RECEIVE will complete with a time out error (RETCODE = 05h).   
  704.         Time outs do not cause session termination. 
  705.  
  706.         RECEIVE commands are completed in the order in which they are 
  707.         issued.  If received data could be used to complete either a 
  708.         RECEIVE or RECEIVE ANY, the RECEIVE is given priority and 
  709.         completed.
  710.  
  711.         The actual size of the received data is returned in BUFLEN.  If 
  712.         the maximum buffer length was smaller than the length of the 
  713.         data, then the buffer is filled to the maximum and RETCODE = 06h 
  714.         is returned.  The next RECEIVE (or RECEIVE ANY) will be completed 
  715.         with the remainder of the data.
  716.  
  717.  
  718.  
  719.                   -------------------
  720.                   Receive Any Command
  721.                   -------------------
  722.  
  723.         This command receives data from any session.  The NUM field 
  724.         specifies the name number of allowable sessions, or 0FFh to 
  725.         receive for any session under any name.  The BUFADR and BUFLEN 
  726.         fields are set to the size and maximum length of the receive data 
  727.         buffer.  The remote session must issue a SEND or CHAIN SEND 
  728.         command.  There is no time-out on this command.  The local 
  729.         session number of a completed receive is returned in LSN.
  730.  
  731.         RECEIVE ANY commands are completed in the order in which they are 
  732.         issued.  If received data could be used to complete either a 
  733.  
  734.  
  735.                                        9
  736.  
  737.  
  738.  
  739.         RECEIVE or RECEIVE ANY, the RECEIVE is given priority and 
  740.         completed.
  741.  
  742.         The actual size of the received data is returned in BUFLEN.  If 
  743.         the maximum buffer length was smaller than the length of the 
  744.         data, then the buffer is filled to the maximum and RETCODE = 06h 
  745.         is returned.  The next RECEIVE ANY (or RECEIVE) will be completed 
  746.         with the remainder of the data.
  747.  
  748.         Typically, RECEIVE ANY is used by a process that services 
  749.         multiple users.  Session termination by the local or remote 
  750.         process will cause the next pending RECEIVE ANY to complete with 
  751.         RETCODE = 0Ah (session terminated) or 18h (session terminated 
  752.         abnormally).
  753.  
  754.  
  755.  
  756.                   ---------------------
  757.                   Send Datagram Command
  758.                   ---------------------
  759.  
  760.         This command is used to send a datagram message.  The Net Bios 
  761.         does not necessarily detect whether the message was successfully 
  762.         delivered.  The NUM field associates the datagram with a local 
  763.         name.  The CALLNAME field specifies the destination name (may be 
  764.         a group name).  BUFADR and BUFLEN contain the address and length 
  765.         of the message.  Maximum allowable length is 512 bytes.
  766.  
  767.  
  768.  
  769.                   ------------------------
  770.                   Receive Datagram Command
  771.                   ------------------------
  772.  
  773.         This command waits for a SEND DATAGRAM to the name associated 
  774.         with the NUM field (may be a group name). An 0FFh in the NUM 
  775.         field is used to receive all datagrams to the machine.  The 
  776.         BUFADR and BUFLEN fields are set to the size and maximum length 
  777.         of the receive data buffer.  There is no time-out on this 
  778.         command.  The name of the sender is returned in CALLNAME.
  779.  
  780.         The actual size of the received data is returned in BUFLEN.  If 
  781.         the maximum buffer length was smaller than the length of the 
  782.         data, then the buffer is filled to the maximum and RETCODE = 06h 
  783.         is returned.  The remaining data is lost. 
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                                        10
  797.  
  798.  
  799.  
  800.                   ----------------------
  801.                   Send Broadcast Command
  802.                   ----------------------
  803.  
  804.         This command is used to send a broadcast message.  The Net Bios 
  805.         does not necessarily detect whether the message was successfully 
  806.         delivered.  The NUM field associates the datagram with a local 
  807.         name.  BUFADR and BUFLEN contain the address and length 
  808.         of the message.  Maximum allowable length is 512 bytes.
  809.  
  810.         Each SEND BROADCAST satisfies all outstanding RECEIVE BROADCAST 
  811.         commands on the network.
  812.  
  813.  
  814.  
  815.                   -------------------------
  816.                   Receive Broadcast Command
  817.                   -------------------------
  818.  
  819.         This command waits for a SEND BROADCAST message.  The NUM field 
  820.         must contain a valid name number.  The BUFADR and BUFLEN fields 
  821.         are set to the size and maximum length of the receive data 
  822.         buffer.  There is no time-out on this command.  The name of the 
  823.         sender is returned in CALLNAME.
  824.  
  825.         Each SEND BROADCAST satisfies all outstanding RECEIVE BROADCAST 
  826.         commands on the network.
  827.  
  828.         The actual size of the received data is returned in BUFLEN.  If 
  829.         the maximum buffer length was smaller than the length of the 
  830.         data, then the buffer is filled to the maximum and RETCODE = 06h 
  831.         is returned.  The remaining data is lost. 
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.                                        11
  858.  
  859.  
  860.  
  861.                                      Table 1
  862.                             Net Bios Command Summary
  863.         -----------------------------------------------------------------
  864.         | Command | Command Code|No Wait |                              |
  865.         | Name    ----------Hex |Code-----     Description              |
  866.         |---------------------------------------------------------------|
  867.         |                        General Commands                       |
  868.         |---------------------------------------------------------------|
  869.         | RESET            | 32 | -- | Reset Net Bios.                  |
  870.         |------------------+----+----+----------------------------------|
  871.         | CANCEL           | 35 | -- | Cancel a pending command.        |
  872.         |------------------+----+----+----------------------------------|
  873.         | ADAPTER STATUS   | 33 | B3 | Get status of a Net Bios.        |
  874.         |------------------+----+----+----------------------------------|
  875.         | UNLINK           | 70 | -- | Cancel boot redirection.         |
  876.         |---------------------------------------------------------------|
  877.         |                         Name Commands                         |
  878.         |---------------------------------------------------------------|
  879.         | ADD NAME         | 30 | B0 | Add unique name to name table.   |
  880.         |------------------+----+----+----------------------------------|
  881.         | ADD GROUP NAME   | 36 | B6 | Add non-unique name to table.    |
  882.         |------------------+----+----+----------------------------------|
  883.         | DELETE NAME      | 31 | B1 | Delete name from name table.     |
  884.         |---------------------------------------------------------------|
  885.         |                   Session Control Commands                    |
  886.         |---------------------------------------------------------------|
  887.         | CALL             | 10 | 90 | Establish session with another.  |
  888.         |------------------+----+----+----------------------------------|
  889.         | LISTEN           | 11 | 91 | Wait for a CALL from another.    |
  890.         |------------------+----+----+----------------------------------|
  891.         | HANG UP          | 12 | 92 | Close session.                   |
  892.         |------------------+----+----+----------------------------------|
  893.         | SESSION STATUS   | 34 | B4 | Status of sessions under name.   |
  894.         |---------------------------------------------------------------|
  895.         |                Session Data Transfer Commands                 |
  896.         |---------------------------------------------------------------|
  897.         | SEND             | 14 | 94 | Send session data.               |
  898.         |------------------+----+----+----------------------------------|
  899.         | CHAIN SEND       | 17 | 97 | Concatenate and send two buffers.|
  900.         |------------------+----+----+----------------------------------|
  901.         | RECEIVE          | 15 | 95 | Receive session data.            |
  902.         |------------------+----+----+----------------------------------|
  903.         | RECEIVE ANY      | 16 | 96 | Receive data from any session    |
  904.         |                  |    |    | under specified name.            |
  905.         |---------------------------------------------------------------|
  906.         |                       Datagram Commands                       |
  907.         |---------------------------------------------------------------|
  908.         | SEND DATAGRAM    | 20 | A0 | Send data, addressed by name.    |
  909.         |------------------+----+----+----------------------------------|
  910.         | RECEIVE DATAGRAM | 21 | A1 | Receive datagram to name.        |
  911.         |------------------+----+----+----------------------------------|
  912.         | SEND BROADCAST   | 22 | A2 | Send data to all stations.       |
  913.         |------------------+----+----+----------------------------------|
  914.         | RECEIVE BROADCAST| 23 | A3 | Enable receive of next broadcast.|
  915.         -----------------------------------------------------------------
  916.  
  917.  
  918.                                        12
  919.  
  920.  
  921.  
  922.                                      Table 2
  923.                        Net Bios Control Block (NCB) Format
  924.         -----------------------------------------------------------------
  925.         |Off-|Size |  Field  |                Field                     |
  926.         |set |Bytes|  Name   |             Description                  |
  927.         |----+-----+---------+------------------------------------------|
  928.         |  0 |  1  | COMMAND | Net Bios command code.  High order bit   |
  929.         | Hex|     |         | set indicates no-wait mode.              |
  930.         |----+-----+---------+------------------------------------------|
  931.         |  1 |  1  | RETCODE | Completion result.  Zero if no error.    |
  932.         |----+-----+---------+------------------------------------------|
  933.         |  2 |  1  | LSN     | Local session number (1 to 254). Returned|
  934.         |    |     |         | by CALL and LISTEN, and supplied for     |
  935.         |    |     |         | SEND and RECEIVE commands.               |
  936.         |----+-----+---------+------------------------------------------|
  937.         |  3 |  1  | NUM     | Name Number (1 to 254). Returned by ADD  |
  938.         |    |     |         | NAME commands, and supplied for RECEIVE  |
  939.         |    |     |         | ANY and datagram commands.               |
  940.         |----+-----+---------+------------------------------------------|
  941.         |  4 |  4  | BUFADR  | Address of message for send and receive. |
  942.         |----+-----+---------+------------------------------------------|
  943.         |  8 |  2  | BUFLEN  | Length of message buffer. For receive    |
  944.         |    |     |         | commands, supply the maximum buffer size |
  945.         |    |     |         | and the actual length is returned.       |
  946.         |----+-----+---------+------------------------------------------|
  947.         | 0A | 16  | CALLNAME| Name from/of remote machine for CALL,    |
  948.         |    | Dec |         | LISTEN and datagrams.  For a CHAIN SEND  |
  949.         |    |     |         | command, the first word specifies the    |
  950.         |    |     |         | length of the second buffer, and the     |
  951.         |    |     |         | next two words specify the address.      |
  952.         |----+-----+---------+------------------------------------------|
  953.         | 1A | 16  | NAME    | Local name. Specifies name to add for ADD|
  954.         |    |     |         | NAME, or name to use for other commands. |
  955.         |----+-----+---------+------------------------------------------|
  956.         | 2A |  1  | RTO     | Receive time-out in .5 second increments.|
  957.         |    |     |         | Supplied on CALL and LISTEN commands.    |
  958.         |----+-----+---------+------------------------------------------|
  959.         | 2B |  1  | STO     | Send time-out in .5 second increments.   |
  960.         |    |     |         | Supplied on CALL and LISTEN commands.    |
  961.         |----+-----+---------+------------------------------------------|
  962.         | 2C |  4  | POST    | Address of user interrupt routine called |
  963.         |    |     |         | when command completes and no-wait mode  |
  964.         |    |     |         | mode was specified in command code. Not  |
  965.         |    |     |         | called if set to 0:0.                    |
  966.         |----+-----+---------+------------------------------------------|
  967.         | 30 |  1  | LANA_NUM| Number of adapter card -- 0 for the first|
  968.         |    |     |         | and 1 for the second, if applicable.     |
  969.         |----+-----+---------+------------------------------------------|
  970.         | 31 |  1  | CMD_DONE| Command completed flag. A value of 0FFH  |
  971.         |    |     |         | indicates the command has not completed. |
  972.         |    |     |         | When the command has completed, CMD_DONE |
  973.         |    |     |         | is set to same value as RETCODE.         |
  974.         |----+-----+---------+------------------------------------------|
  975.         | 32 | 14  | RES     | Used internally by Net Bios.             |
  976.         -----------------------------------------------------------------
  977.  
  978.  
  979.                                        13
  980.  
  981.  
  982.  
  983.                                      Table 3
  984.                               NCB Usage by Command
  985.         -----------------------------------------------------------------
  986.         |               | C | R | L | N | B | B | C | N | R | P | L | C |
  987.         |               | O | E | S | U | U | U | A | A | T | O | A | M |
  988.         |               | M | T | N | M | F | F | L | M | O | S | N | D |
  989.         |               | M | C |   |   | A | L | L | E | & | T | A | _ |
  990.         |               | A | O |   |   | D | E | N |   | S |   | _ | D |
  991.         |               | N | D |   |   | R | N | A |   | T |   | N | O |
  992.         |               | D | E |   |   |   |   | M |   | O |   | U | N |
  993.         |               |   |   |   |   |   |   | E |   |   |   | M | E |
  994.         |               |   |   |   |   |   |   |   |   |   |   |   |   |
  995.         |    Command    |   |   |   |   |BUF|BUF|CAL|   |RTO|   |LAN|CMD|
  996.         |      Name     |CMD|RET|LSN|NUM|ADR|LEN|NAM|NAM|STO|PST|NUM|DON|
  997.         |---------------+---+---+---+---+---+---+---+---+---+---+---+---|
  998.         |RESET          | I | O | I | I | - | - | - | - | - | - | I | O |
  999.         |CANCEL         | I | O | - | - | I | - | - | - | - | - | I | O |
  1000.         |ADAPTER STATUS | I | O | - | - | I |I/O| I | - | - | I | I | O |
  1001.         |UNLINK         | I | O | - | - | - | - | - | - | - | - | I | O |
  1002.         |---------------+---+---+---+---+---+---+---+---+---+---+---+---|
  1003.         |ADD NAME       | I | O | - | O | - | - | - | I | - | I | I | O |
  1004.         |ADD GROUP NAME | I | O | - | O | - | - | - | I | - | I | I | O |
  1005.         |DELETE NAME    | I | O | - | - | - | - | - | I | - | I | I | O |
  1006.         |---------------+---+---+---+---+---+---+---+---+---+---+---+---|
  1007.         |CALL           | I | O | O | - | - | - | I | I | I | I | I | O |
  1008.         |LISTEN         | I | O | O | - | - | - |I/O| I | I | I | I | O |
  1009.         |HANG UP        | I | O | I | - | - | - | - | - | - | I | I | O |
  1010.         |SESSION STATUS | I | O | - | - | I |I/O| - | I | - | I | I | O |
  1011.         |---------------+---+---+---+---+---+---+---+---+---+---+---+---|
  1012.         |SEND           | I | O | I | - | I | I | - | - | - | I | I | O |
  1013.         |CHAIN SEND     | I | O | I | - | I | I | I | - | - | I | I | O |
  1014.         |RECEIVE        | I | O | I | - | I |I/O| - | - | - | I | I | O |
  1015.         |RECEIVE ANY    | I | O | O | I | I |I/O| - | - | - | I | I | O |
  1016.         |---------------+---+---+---+---+---+---+---+---+---+---+---+---|
  1017.         |SEND DATAGRAM  | I | O | - | I | I | I | I | - | - | I | I | O |
  1018.         |RECV DATAGRAM  | I | O | - | I | I |I/O| O | - | - | I | I | O |
  1019.         |SEND BROADCAST | I | O | - | I | I | I | - | - | - | I | I | O |
  1020.         |RECV BROADCAST | I | O | - | I | I |I/O| O | - | - | I | I | O |
  1021.         -----------------------------------------------------------------
  1022.  
  1023.              Legend
  1024.                 I  =  Field is input (passed to Net Bios)
  1025.                 O  =  Field is output (returned by Net Bios)
  1026.                I/O =  Field is used for both input and output
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.                                        14
  1041.  
  1042.  
  1043.  
  1044.                                      Table 4
  1045.                               Net Bios Error Codes
  1046.         -----------------------------------------------------------------
  1047.         | Code |                   Description                          |
  1048.         |------+--------------------------------------------------------|
  1049.         |  00  | No error.                                              |
  1050.         |------+--------------------------------------------------------|
  1051.         |  01  | Illegal buffer length.  A SEND BROADCAST or SEND       |
  1052.         |      | DATAGRAM command specified a length greater than 512   |
  1053.         |      | bytes, or a status command specified a buffer length   |
  1054.         |      | smaller than minimum allowed.                          |
  1055.         |------+--------------------------------------------------------|
  1056.         |  03  | Invalid command.                                       |
  1057.         |------+--------------------------------------------------------|
  1058.         |  05  | Time out.  For SEND, RECEIVE, and HANG UP commands, the|
  1059.         |      | time-out specified when the session was established has|
  1060.         |      | elapsed.  For a CALL or ADAPTER STATUS command, an     |
  1061.         |      | internal timer expired.                                |
  1062.         |------+--------------------------------------------------------|
  1063.         |  06  | Message Incomplete.  The buffer size specified in the  |
  1064.         |      | NCB was not large enough to hold the receive data. For |
  1065.         |      | RECEIVE or RECEIVE ANY commands, the next command will |
  1066.         |      | get the rest of the data.  For other commands, the     |
  1067.         |      | remaining data is lost.                                |
  1068.         |------+--------------------------------------------------------|
  1069.         |  08  | Invalid local session number (LSN).                    |
  1070.         |------+--------------------------------------------------------|
  1071.         |  09  | Out of resources.  The Net Bios is out of some internal|
  1072.         |      | resource, such as buffers.  Delay and reissue the      |
  1073.         |      | command.                                               |
  1074.         |------+--------------------------------------------------------|
  1075.         |  0A  | Session closed.  For a SEND, RECEIVE, RECEIVE ANY, or  |
  1076.         |      | HANG UP, this indicates that the session was terminated|
  1077.         |      | by the remote computer.                                |
  1078.         |------+--------------------------------------------------------|
  1079.         |  0B  | Command canceled.  Command execution of the NCB was    |
  1080.         |      | aborted by the CANCEL command.                         |
  1081.         |------+--------------------------------------------------------|
  1082.         |  0D  | Duplicate local name.  An ADD NAME command specified   |
  1083.         |      | an existing name.                                      |
  1084.         |------+--------------------------------------------------------|
  1085.         |  0E  | Name table full.                                       |
  1086.         |------+--------------------------------------------------------|
  1087.         |  0F  | DELETE NAME completed, but name has active sessions    |
  1088.         |      | (name will be deleted when all sessions closed).       |
  1089.         |------+--------------------------------------------------------|
  1090.         |  11  | Local session table full.                              |
  1091.         -----------------------------------------------------------------
  1092.                               (Continued Next Page)
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.                                        15
  1102.  
  1103.  
  1104.  
  1105.                                Table 4 (Continued)
  1106.                               Net Bios Error Codes
  1107.         -----------------------------------------------------------------
  1108.         | Code |                   Description                          |
  1109.         |------+--------------------------------------------------------|
  1110.         |  12  | Remote computer not listening.  On a CALL, the remote  |
  1111.         |      | computer was found, but had no outstanding LISTEN for  |
  1112.         |      | the CALL.                                              |
  1113.         |------+--------------------------------------------------------|
  1114.         |  13  | Invalid name number.                                   |
  1115.         |------+--------------------------------------------------------|
  1116.         |  14  | Name not found.                                        |
  1117.         |------+--------------------------------------------------------|
  1118.         |  15  | Name not found or "*" or 00h in first byte of remote   |
  1119.         |      | name field on a CALL.                                  |
  1120.         |------+--------------------------------------------------------|
  1121.         |  16  | Name already exists on network.                        |
  1122.         |------+--------------------------------------------------------|
  1123.         |  17  | Name was deleted.                                      |
  1124.         |------+--------------------------------------------------------|
  1125.         |  18  | Session terminated abnormally.  Connection with the    |
  1126.         |      | remote computer was lost.                              |
  1127.         |------+--------------------------------------------------------|
  1128.         |  19  | Name conflict.  Two computers using the same name was  |
  1129.         |      | detected.                                              |
  1130.         |------+--------------------------------------------------------|
  1131.         |  21  | Interface busy.  The Net Bios cannot execute because   |
  1132.         |      | it was called from an interrupt handler.               |
  1133.         |------+--------------------------------------------------------|
  1134.         |  22  | Too many commands issued.                              |
  1135.         |------+--------------------------------------------------------|
  1136.         |  23  | Invalid LAN adapter (LANA) number.                     |
  1137.         |------+--------------------------------------------------------|
  1138.         |  24  | Command completed before canceled.  Returned in CANCEL |
  1139.         |      | NCB when target command completed normally.            |
  1140.         |------+--------------------------------------------------------|
  1141.         |  26  | Invalid cancel command.  The target NCB could not be   |
  1142.         |      | found.                                                 |
  1143.         |------+--------------------------------------------------------|
  1144.         |40-FE | Hardware error.                                        |
  1145.         |------+--------------------------------------------------------|
  1146.         |  FF  | Indicates the command has not completed.               |
  1147.         -----------------------------------------------------------------
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.                                        16
  1163.  
  1164.  
  1165.  
  1166.                                      Table 5
  1167.                           Adapter Status Result Buffer
  1168.         -----------------------------------------------------------------
  1169.         | Off- | Size  |                  Field                         |
  1170.         | set  | Bytes |                Description                     |
  1171.         |------+-------+------------------------------------------------|
  1172.         |   0  |   6   | Permanent node name.  This six byte identifier |
  1173.         |(Hex) | (Dec) | is obtained from either a ROM on the LAN card  |
  1174.         |      |       | or from the node address DIP switch.           |
  1175.         |------+-------+------------------------------------------------|
  1176.         |   6  |   1   | External jumper status.  The high bit of this  |
  1177.         |      |       | byte indicates the interrupt number used by    |
  1178.         |      |       | the LAN card -- 0 for IRQ 2 and 1 for IRQ 3.   |
  1179.         |      |       | The second highest bit indicates the DMA chan- |
  1180.         |      |       | nel used by the LAN card -- 0 for channel 1    |
  1181.         |      |       | and 1 for channel 3.  This byte is not sup-    |
  1182.         |      |       | ported in all implementations.                 |
  1183.         |------+-------+------------------------------------------------|
  1184.         |   7  |   1   | Power on test result.  Always zero in current  |
  1185.         |      |       | versions.                                      |
  1186.         |------+-------+------------------------------------------------|
  1187.         |   8  |   2   | Software version.  First byte is the major     |
  1188.         |      |       | version, second is the minor version number.   |
  1189.         |------+-------+------------------------------------------------|
  1190.         |  0A  |   2   | Minutes since system started.  When this field |
  1191.         |      |       | reaches 0FFFFH, it rolls over to 0.            |
  1192.         |------+-------+------------------------------------------------|
  1193.         |  0C  |   2   | Number of CRC errors on received packets. (1)  |
  1194.         |------+-------+------------------------------------------------|
  1195.         |  0E  |   2   | Number of alignment errors. (1)                |
  1196.         |------+-------+------------------------------------------------|
  1197.         |  10  |   2   | Number of transmit collisions.  (1)            |
  1198.         |------+-------+------------------------------------------------|
  1199.         |  12  |   2   | Number of aborted transmits.  (1)              |
  1200.         |------+-------+------------------------------------------------|
  1201.         |  14  |   4   | Number of packets transmitted.  When this      |
  1202.         |      |       | field reaches 0FFFFFFFFH, it rolls over to 0.  |
  1203.         |------+-------+------------------------------------------------|
  1204.         |  18  |   4   | Number of packets received.  When this field   |
  1205.         |      |       | reaches 0FFFFFFFFH, it rolls over to 0.        |
  1206.         |------+-------+------------------------------------------------|
  1207.         |  1C  |   2   | Number of retransmits. (1)                     |
  1208.         |------+-------+------------------------------------------------|
  1209.         |  1E  |   2   | Number of times receiver was out of buffers.   |
  1210.         |      |       | (1)                                            |
  1211.         |------+-------+------------------------------------------------|
  1212.         |  20  |   8   | Not used -- reserved.                          |
  1213.         -----------------------------------------------------------------
  1214.                               (Continued Next Page)
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.                                        17
  1224.  
  1225.  
  1226.  
  1227.                                Table 5 (Continued)
  1228.                           Adapter Status Result Buffer
  1229.         -----------------------------------------------------------------
  1230.         | Off- | Size  |                  Field                         |
  1231.         | set  | Bytes |                Description                     |
  1232.         |------+-------+------------------------------------------------|
  1233.         |  28  |   2   | Number of free network command blocks (NCBs).  |
  1234.         | (Hex)| (Dec) | (2)                                            |
  1235.         |------+-------+------------------------------------------------|
  1236.         |  2A  |   2   | Number of NCBs specified in last RESET command.|
  1237.         |------+-------+------------------------------------------------|
  1238.         |  2C  |   2   | Maximum possible number of NCBs that can be    |
  1239.         |      |       | specified in RESET command.                    |
  1240.         |------+-------+------------------------------------------------|
  1241.         |  2E  |   4   | Not used -- reserved.                          |
  1242.         |------+-------+------------------------------------------------|
  1243.         |  32  |   2   | Number of pending or active sessions.          |
  1244.         |------+-------+------------------------------------------------|
  1245.         |  34  |   2   | Number of possible sessions specified in last  |
  1246.         |      |       | RESET command.                                 |
  1247.         |------+-------+------------------------------------------------|
  1248.         |  36  |   2   | Maximum number of possible sessions that can   |
  1249.         |      |       | be specified in RESET command.                 |
  1250.         |------+-------+------------------------------------------------|
  1251.         |  38  |   2   | Maximum packet size supported on the network.  |
  1252.         |      |       | Note, this is not related to the maximum       |
  1253.         |      |       | session message size, which is 64K bytes.      |
  1254.         |------+-------+------------------------------------------------|
  1255.         |  3A  |   2   | Number of names in name table.                 |
  1256.         |------+-------+------------------------------------------------|
  1257.         |  3C  |  18   | First name in name table. (3)                  |
  1258.         |      |       |   * 16 bytes - name                            |
  1259.         |      |       |   *  1 byte  - name number (2 to 254)          |
  1260.         |      |       |   *  1 byte  - name status.  Bit patterns are: |
  1261.         |      |       |        *  G----000 - name add in progress      |
  1262.         |      |       |        *  G----100 - active name               |
  1263.         |      |       |        *  G----101 - delete pending            |
  1264.         |      |       |        *  G----110 - improper duplicate name   |
  1265.         |      |       |        *  G----111 - duplicate name, delete    |
  1266.         |      |       |                      pending                   |
  1267.         |------+-------+------------------------------------------------|
  1268.         |  4E  | X18   | Addition name table entries as needed.         |
  1269.         -----------------------------------------------------------------
  1270.  
  1271.         Notes
  1272.           1  These fields will not increment further after reaching 
  1273.              0FFFFH.
  1274.           2  In some implementations, there is no limit on the number of 
  1275.              NCBs pending, so an arbitrary large number is used in these 
  1276.              fields.
  1277.           3  The permanent name (name number 1) does not appear in the 
  1278.              name table.
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.                                        18
  1285.  
  1286.  
  1287.  
  1288.                                      Table 6
  1289.                           Session Status Result Buffer
  1290.         -----------------------------------------------------------------
  1291.         | Off- | Size  |                  Field                         |
  1292.         | set  | Bytes |                Description                     |
  1293.         |------+-------+------------------------------------------------|
  1294.         |   0  |   1   | Sessions' name number.                         |
  1295.         |------+-------+------------------------------------------------|
  1296.         |   1  |   1   | Number of sessions under name.                 |
  1297.         |------+-------+------------------------------------------------|
  1298.         |   2  |   1   | Number of RECEIVE DATAGRAM and RECEIVE         |
  1299.         | (Hex)| (Dec) | BROADCAST commands outstanding.                |
  1300.         |------+-------+------------------------------------------------|
  1301.         |   3  |   1   | Number of RECEIVE ANY commands outstanding.    |
  1302.         |------+-------+------------------------------------------------|
  1303.         |  (4) | (36)  | Session status - first session (if at least 1).|
  1304.         |   4  |   1   |  * Local session number (LSN).                 |
  1305.         |   5  |   1   |  * Session state                               |
  1306.         |      |       |     1: LISTEN pending   4: HANG UP pending     |
  1307.         |      |       |     2: CALL pending     5: HANG UP complete    |
  1308.         |      |       |     3: Active           6: Session aborted     |
  1309.         |   6  |  16   |  * Local name (NAME)                           |
  1310.         |  16  |  16   |  * Remote name (CALLNAME)                      |
  1311.         |  26  |   1   |  * Number of RECEIVE commands outstanding      |
  1312.         |  27  |   1   |  * Number of SEND and CHAIN SEND commands      |
  1313.         |      |       |    outstanding                                 |
  1314.         |------+-------+------------------------------------------------|
  1315.         |  28  |  X36  | Session status for additional sessions as      |
  1316.         |      |       | needed                                         |
  1317.         -----------------------------------------------------------------
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.                                        19
  1346.